x86/mm: Clean up unshare path for foreign mappings
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Thu, 28 Jun 2012 11:45:09 +0000 (12:45 +0100)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Thu, 28 Jun 2012 11:45:09 +0000 (12:45 +0100)
commit36ea7eeff8a6b0fbaeebe9c873a55e0c077cd1ad
treef6d815780382f9b73c569615f96509c2eec860dd
parentb2ff98b2f208146e3976837e125119ac1a901fe1
x86/mm: Clean up unshare path for foreign mappings

In its current shape, if Xen unshares a foreign gfn successfully while building
a foreign writable map, it is left with a reference to the old shared page in
the "target" var.

Instead, push unsharing request down on the initial get_page_from_gfn call,
which will DTRT.

This allows for greatly simplifying the unshare related condition handling,
removing ugly comments and s86_64 ifdef-ery.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm.c